//
// Created by laizili on 2021/6/2.
//

#include "apue.h"
#include <sys/wait.h>

int main(int argc, char *argv[]) {
  pid_t pid;
  if ((pid = fork()) < 0) {
    err_sys("fork error");
  } else if (pid > 0) {
    waitpid(pid, NULL, 0);
  } else {
    setsid();
  }
  return 0;
}